﻿using System.Collections.Generic;
using System.ServiceModel;

namespace __ts.Core.Plugin
{
    /// <summary>
    /// 
    /// </summary>
    public interface IPlugin
    {
        /// <summary>
        /// 插件Key
        /// </summary>
        string Key { get; }
        /// <summary>
        /// 插件描述
        /// </summary>
        string Description { get; }
        /// <summary>
        /// 插件名称
        /// </summary>
        string Name { get; }
        /// <summary>
        /// 插件文件路径
        /// </summary>
        string AssemblyPath { get; }
        /// <summary>
        /// 提供服务的端口
        /// </summary>
        List<int> Ports { get; }
        /// <summary>
        /// 托管状态
        /// </summary>
        CommunicationState State { get; }
        /// <summary>
        /// 插件托管前事件
        /// </summary>
        void BeforeStartUp();
        /// <summary>
        /// 插件托管后事件
        /// </summary>
        void OnStartUp();
        /// <summary>
        /// 开始托管
        /// </summary>
        bool Host();
        /// <summary>
        /// 停止托管
        /// </summary>
        bool Unhost();
        /// <summary>
        /// 开始托管的时间
        /// </summary>
        string HostDate { get; set; }
    }
}
